package MyOop03;

import java.util.Scanner;

public class PhoneTest {
    public static void main(String[] args) {
        Phone[] arr = new Phone[3];

        Scanner scanner = new Scanner(System.in);
        for (int i = 0; i < arr.length; i++) {
            Phone a = new Phone();
            System.out.println("请输入手机的品牌：");
            String brand = scanner.next();
            a.setBrand(brand);
            System.out.println("请输入手机的价格：");
            int price = scanner.nextInt();
            a.setPrice(price);
            System.out.println("请输入手机的颜色：");
            String color = scanner.next();
            a.setColor(color);
            arr[i] = a;
        }
        int sum = 0;
        for (int i = 0; i < args.length; i++) {
            Phone phone = arr[i];
            sum = (int) (sum+ phone.getPrice());
        }
        int avg = sum/ arr.length;
        System.out.println(avg);
    }
}
